// 通用文本省略 mixin
@mixin textEllipsis($lines: 1) {
  @if $lines == 1 {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  } @else {
    display: -webkit-box;
    -webkit-line-clamp: $lines;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}

.cardItem {
  padding: 20px;
  transition: all 0.3s ease;
  cursor: pointer;
  position: relative;
  min-height: 200px;
  display: flex;
  flex-direction: column;
  border-radius: 20px;
  background: #FFFFFF;
  border: 1px solid transparent;
  /* 阴影/一级 */
  box-shadow: 0px 1px 10px 0px rgba(122, 120, 150, 0.1);
  font-family: 'PingFang-Sim';

  &:hover {
    border-color: #6356EA;
    /* 阴影/二级 */
    box-shadow: 0px 4px 16px 0px rgba(134, 130, 191, 0.3);
  }
}

.statusTag {
  position: absolute;
  top: 0;
  right: 0;
  padding: 4px 12px;
  border-radius: 0 18px 0 8px;
  font-family: 'PingFang-Sim';
  font-size: 14px;
  font-weight: 500;
  line-height: normal;
  letter-spacing: normal;
}

.header {
  display: flex;
  align-items: center;
  gap: 12px;

  .apiIcon {
    width: 48px;
    height: 48px;
    background: linear-gradient(135deg, #87CEEB 0%, #B0E0E6 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(135, 206, 235, 0.3);
  }

  .title {
    font-size: 20px;
    font-weight: 500;
    line-height: 26px;
    letter-spacing: normal;
    color: #000000;
    @include textEllipsis(1);
  }
}

.content {
  flex: 1;
  margin: 12px 0;

  .description {
    font-size: 14px;
    font-weight: normal;
    line-height: 22px;
    text-align: justify; /* 浏览器可能不支持 */
    display: flex;
    align-items: center;
    letter-spacing: normal;
    /* 颜色/文本中性色/副标题、次要正文内容 */
    color: #676773;
    @include textEllipsis(2);
  }

  .relatedApps {
    margin-top: 8px;

    .relatedAppsTag {
      background: #ebeeff;
      color: #333;
      padding: 4px 8px;
      border-radius: 4px;
      font-size: 12px;
      display: inline-block;
    }
  }
}

.footer {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 4px;

  .publishTime {
    flex: 1;
    font-family: PingFang SC;
    font-size: 12px;
    font-weight: normal;
    line-height: 24px;
    /* 颜色/文本中性色/辅助色（说明、标签） */
    color: #B5B5B5;
    @include textEllipsis(1);
  }

  .actionGroup {
    flex-shrink: 0;
  }
}

// 响应式设计
@media (max-width: 768px) {
  .cardItem {
    padding: 16px;
    min-height: 180px;
  }
  
  .apiIcon {
    width: 40px;
    height: 40px;
  }
  
  .apiText {
    font-size: 12px;
  }
  
  .title {
    font-size: 16px;
  }
  
  .description {
    font-size: 13px;
  }
  
  .footer {
    flex-direction: column;
    gap: 12px;
    align-items: flex-start;
  }
}